from datetime import datetime


def print_time(func):
    def wrapper():
        print("Run time: {}".format(datetime.now()))
        return func()

    return wrapper


@print_time
def foo():
    print("I am foo")


foo()


def cache(func):
    _cached = {}

    def wrapper(n):
        if n in _cached:
            return _cached[n]
        else:
            result = func(n)
            _cached[n] = result
            return result

    return wrapper


@cache
def fib(n):
    if n == 1:
        return 1
    if n == 2:
        return 1

    return fib(n-2) + fib(n-1)


print(fib(100))